from my315ok.flowrate import total,write,pkopenr
from zope.component import getMultiAdapter


def addaccess(site,event):
   
#    obj = site
#    pc = getToolByName(site, 'portal_catalog')
    global total
    import cPickle
    f = pkopenr('links.pkl')
    links = cPickle.load(f)
    f.close()
    del cPickle,f
    


    URL = event.request.getURL()
   
   
    if  URL in links:      
        total = total + 1 
        print URL,total
        write(str(total),'total')
    else:
        pass           
    return
    
    
   
